﻿using System;
using System.ComponentModel;

namespace RiskMan.DataClass.Models.Plaza_II
{
    public class TestCalculationIndikators: INotifyPropertyChanged
    {
        #region private

        private double _last;
        private DateTime _date;
        private int _indexRow;

        private double _smallSignalLineAvgFast;
        private double _smallSignalLineAvgSlow;
        private double _smallSignalLine;
        private double _smallMacd;
        private double _smallDiff;
        private int _smallCountDiff;

        private double _bigSignalLineAvgFast;
        private double _bigSignalLineAvgSlow;
        private double _bigSignalLine;
        private double _bigMacd;
        private double _bigDiff;
        private int _bigCountDiff;

        private double _smallPivotHigh;
        private double _smallPivotLow;

        private double _bigPivotHigh;
        private double _bigPivotLow;
        private double _otstupForSmallPivot;
        private double _otstupForBigPivot;


        private int _numTicksForCrossSmall;
        private int _numTicksForCrossBig;
        private string _comment;


        private double _profit;
        private double _cumProfit;
        private int _countDeal;
        #endregion

        #region public

        
        /// <summary>
        /// Количество сделок
        /// </summary>
        public int CountDeal
        {
            get { return _countDeal; }
            set
            {
                if (_countDeal != value)
                {
                    _countDeal = value;
                    RaisePropertyChanged("CountDeal");
                }
            }
        }
           
        /// <summary>
        /// Накопленная прибыль
        /// </summary>
        public double CumProfit
        {
            get { return _cumProfit; }
            set
            {
                if (_cumProfit != value)
                {
                    _cumProfit = value;
                    RaisePropertyChanged("CumProfit");
                }
            }
        }
           
        /// <summary>
        /// 
        /// </summary>
        public double Profit
        {
            get { return _profit; }
            set
            {
                if (_profit != value)
                {
                    _profit = value;
                    RaisePropertyChanged("Profit");
                }
            }
        }
           

        /// <summary>
        /// Отступ для большого пивота при входе в позицию
        /// </summary>
        public double OtstupForBigPivot
        {
            get { return _otstupForBigPivot; }
            set
            {
                if (_otstupForBigPivot != value)
                {
                    _otstupForBigPivot = value;
                    RaisePropertyChanged("OtstupForBigPivot");
                }
            }
        }
           
        /// <summary>
        ///  Отступ для малого пивота при входе в позицию
        /// </summary>
        public double OtstupForSmallPivot
        {
            get { return _otstupForSmallPivot; }
            set
            {
                if (_otstupForSmallPivot != value)
                {
                    _otstupForSmallPivot = value;
                    RaisePropertyChanged("OtstupForSmallPivot");
                }
            }
        }
           
        
        /// <summary>
        /// комментарий по позиции
        /// </summary>
        public string Comment
        {
            get { return _comment; }
            set
            {
                if (_comment != value)
                {
                    _comment = value;
                    RaisePropertyChanged("Comment");
                }
            }
        }
           
        /// <summary>
        /// 
        /// </summary>
        public int IndexRow
        {
            get { return _indexRow; }
            set
            {
                if (_indexRow != value)
                {
                    _indexRow = value;
                    RaisePropertyChanged("IndexRow");
                }
            }
        }

        /// <summary>
        /// цена тика
        /// </summary>
        public double Last
        {
            get { return _last; }
            set
            {
                if (_last != value)
                {
                    _last = value;
                    RaisePropertyChanged("Last");
                }
            }
        }

        /// <summary>
        /// 
        /// </summary>
        public DateTime Date
        {
            get { return _date; }
            set
            {
                if (_date != value)
                {
                    _date = value;
                    RaisePropertyChanged("Date");
                }
            }
        }

        
        /// <summary>
        /// 
        /// </summary>
        public double SmallSignalLineAvgFast
        {
            get { return _smallSignalLineAvgFast; }
            set
            {
                if (_smallSignalLineAvgFast != value)
                {
                    _smallSignalLineAvgFast = value;
                    RaisePropertyChanged("SmallSignalLineAvgFast");
                }
            }
        }
        
        /// <summary>
        /// 
        /// </summary>
        public double SmallSignalLineAvgSlow
        {
            get { return _smallSignalLineAvgSlow; }
            set
            {
                if (_smallSignalLineAvgSlow != value)
                {
                    _smallSignalLineAvgSlow = value;
                    RaisePropertyChanged("SmallSignalLineAvgSlow");
                }
            }
        }
           

        /// <summary>
        /// 
        /// </summary>
        public double SmallSignalLine
        {
            get { return _smallSignalLine; }
            set
            {
                if (_smallSignalLine != value)
                {
                    _smallSignalLine = value;
                    RaisePropertyChanged("SmallSignalLine");
                }
            }
        }

        /// <summary>
        /// 
        /// </summary>
        public double SmallMacd
        {
            get { return _smallMacd; }
            set
            {
                if (_smallMacd != value)
                {
                    _smallMacd = value;
                    RaisePropertyChanged("SmallMacd");
                }
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public double SmallDiff
        {
            get { return _smallDiff; }
            set
            {
                if (_smallDiff != value)
                {
                    _smallDiff = value;
                    RaisePropertyChanged("SmallDiff");
                }
            }
        }

        /// <summary>
        /// 
        /// </summary>
        public int SmallCountDiff
        {
            get { return _smallCountDiff; }
            set
            {
                if (_smallCountDiff != value)
                {
                    _smallCountDiff = value;
                    RaisePropertyChanged("SmallCountDiff");
                }
            }
        }
        
        /// <summary>
        /// 
        /// </summary>
        public double BigSignalLineAvgFast
        {
            get { return _bigSignalLineAvgFast; }
            set
            {
                if (_bigSignalLineAvgFast != value)
                {
                    _bigSignalLineAvgFast = value;
                    RaisePropertyChanged("BigSignalLineAvgFast");
                }
            }
        }
        
        /// <summary>
        /// 
        /// </summary>
        public double BigSignalLineAvgSlow
        {
            get { return _bigSignalLineAvgSlow; }
            set
            {
                if (_bigSignalLineAvgSlow != value)
                {
                    _bigSignalLineAvgSlow = value;
                    RaisePropertyChanged("BigSignalLineAvgSlow");
                }
            }
        }
           
        /// <summary>
        /// 
        /// </summary>
        public double BigSignalLine
        {
            get { return _bigSignalLine; }
            set
            {
                if (_bigSignalLine != value)
                {
                    _bigSignalLine = value;
                    RaisePropertyChanged("BigSignalLine");
                }
            }
        }

        /// <summary>
        /// 
        /// </summary>
        public double BigMacd
        {
            get { return _bigMacd; }
            set
            {
                if (_bigMacd != value)
                {
                    _bigMacd = value;
                    RaisePropertyChanged("BigMacd");
                }
            }
        }

        /// <summary>
        /// 
        /// </summary>
        public double BigDiff
        {
            get { return _bigDiff; }
            set
            {
                if (_bigDiff != value)
                {
                    _bigDiff = value;
                    RaisePropertyChanged("BigDiff");
                }
            }
        }
        
        /// <summary>
        /// 
        /// </summary>
        public int BigCountDiff
        {
            get { return _bigCountDiff; }
            set
            {
                if (_bigCountDiff != value)
                {
                    _bigCountDiff = value;
                    RaisePropertyChanged("BigCountDiff");
                }
            }
        }
           
        /// <summary>
        /// 
        /// </summary>
        public double SmallPivotHigh
        {
            get { return _smallPivotHigh; }
            set
            {
                if (_smallPivotHigh != value)
                {
                    _smallPivotHigh = value;
                    RaisePropertyChanged("SmallPivotHigh");
                }
            }
        }

        /// <summary>
        /// 
        /// </summary>
        public double SmallPivotLow
        {
            get { return _smallPivotLow; }
            set
            {
                if (_smallPivotLow != value)
                {
                    _smallPivotLow = value;
                    RaisePropertyChanged("SmallPivotLow");
                }
            }
        }

        /// <summary>
        /// 
        /// </summary>
        public double BigPivotHigh
        {
            get { return _bigPivotHigh; }
            set
            {
                if (_bigPivotHigh != value)
                {
                    _bigPivotHigh = value;
                    RaisePropertyChanged("BigPivotHigh");
                }
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public double BigPivotLow
        {
            get { return _bigPivotLow; }
            set
            {
                if (_bigPivotLow != value)
                {
                    _bigPivotLow = value;
                    RaisePropertyChanged("BigPivotLow");
                }
            }
        }


        /// <summary>
        /// Количество тиков для подачи сигнала на малом макди
        /// </summary>
        public int NumTicksForCrossSmall
        {
            get { return _numTicksForCrossSmall; }
            set
            {
                if (_numTicksForCrossSmall != value)
                {
                    _numTicksForCrossSmall = value;
                    RaisePropertyChanged("NumTicksForCrossSmall");
                }
            }
        }

        /// <summary>
        /// Количество тиков для подачи сигнала на большом макди
        /// </summary>
        public int NumTicksForCrossBig
        {
            get { return _numTicksForCrossBig; }
            set
            {
                if (_numTicksForCrossBig != value)
                {
                    _numTicksForCrossBig = value;
                    RaisePropertyChanged("NumTicksForCrossBig");
                }
            }
        }
        #endregion

        #region event PropertyChangedEventHandler

        public event PropertyChangedEventHandler PropertyChanged;

        protected void RaisePropertyChanged(string propertyName)
        {
            var handler = PropertyChanged;
            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        #endregion
    }
}
